{extend  name="manage@public/layout" /}
{block name="content"}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>商户统计</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link" onclick="location.replace(location.href);">
                                <i class="fa fa-refresh"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <!--- 搜索--->
                            <form action="" method="post">
                                <div class="col-sm-2 col-sm-on">
                                    <input type="text" value="{notempty name="data['keyword']"}{$data['keyword']|trim}{/notempty}" name="keyword" placeholder="商户号/商户名称" class="input-sm form-control">
                                </div>
                                <div class="col-sm-2 col-sm-on">
                                    <input id="hello" name="start" value="{empty name="data['start']"}<?php echo date('Y-m-d',time());?>{else/}{$data.start}{/empty}" readonly class="form-control input-sm layer-date">
                                </div>
                                <div class="col-sm-1 col-sm-botton">
                                    <div class="input-group">
                                        <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search"></i></button>
                                    </div>
                                </div>
                                <div class="col-sm-1 col-sm-botton">
                                    <div class="input-group">
                                        <button title="导出" type="submit" name="mch_export" value="export" class="btn btn-sm btn-primary"><i class="fa fa-download"></i></button>
                                    </div>
                                </div>
                            </form>
                            <!--- end --->
                            <table class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th>商户号</th>
                                        <th>商户名称</th>
                                        <th>日期</th>
                                        <th>请求总额/笔数</th>
                                        <th>已支付/笔数</th>
                                        <th>未支付/笔数</th>
                                        <th>商户结算</th>
                                        <th>手续费</th>
                                        <th>成功率</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name="list" id="vo"}
                                    <tr>
                                        <td>{$vo.mch_id}</td>
                                        <td>{:\\app\\model\\Mch::getMch($vo.mch_id)}</td>
                                        <td>{$vo.create_time}</td>
                                        <td>{$vo.max_amount|abs}/{$vo.max_count}</td>
                                        <td>{$vo.actual_amount|abs}/{$vo.succ_num}</td>
                                        <td>{$vo.pay_amount|abs}/{$vo.err_num}</td>
                                        <th style="color: red;">{$vo.settle|abs}</th>
                                        <td>{$vo.total_fee|abs}</td>
                                        <td>{$vo.succ_num/$vo.max_count*100|intval} %</td>
                                        <td><span class="btn btn-sm btn-white"> <i class="fa fa-ban">&nbsp;无可操作</i> </span></td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                            <div style="float:right;" class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                                {$page|raw}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
    <input type='hidden' name="st_start" value="<?php echo date('Y-m-d 00:00:00',strtotime('-7 days'))?>" />
<input type='hidden' name="st_end" value="<?php echo date('Y-m-d 23:59:59',time());?>" />
{/block}
{block name="script"}
<script>
    laydate({
        elem:"#hello",event:"focus",
         min:$("input[name='st_start']").val(),
        max:$("input[name='st_end']").val(),
    });
</script>
{/block}

